package com.ics.atable.chat.constant;

import lombok.Getter;

/**
 * 向量数据库常量类
 *
 * @author haohongbin
 */
public class VectorDatabaseConstant {

    // item
    public static final String ITEM_COLLECTION_NAME = "item_v1";

    @Getter
    public enum ItemField {
        ITEM_UUID("item_uuid", "指标uuid"),
        ITEM_FULL_NAME("item_full_name", "指标全名"),
        ITEM_NAME("item_name", "指标名"),
        ITEM_FATHER_NAME("item_father_name", "指标父级名称"),
        ITEM_GRANDFATHER_NAME("item_grandfather_name", "指标祖父级名称"),
        METADATA("metadata", "指标元数据"),
        TABLE_UUID("table_uuid", "表uuid"),
        TABLE_NAME("table_name", "表名"),
        ITEM_LIST("item_list", "指标列表");

        private String code;
        private String desc;
        ItemField(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public ItemField getByCode(String itemField) {
            for (ItemField value : values()) {
                if (value.name().equalsIgnoreCase(itemField)) {
                    return value;
                }
            }
            return null;
        }

    }

    // address
    public static final String ADDRESS_COLLECTION_NAME = "address";

    @Getter
    public enum AddressField {
        ORG_ID("org_id", "机构ID"),
        VILLAGE_NAME("village_name", "村名"),
        TOWN_NAME("town_name", "镇名"),
        COUNTY_NAME("county_name", "县名"),
        CITY_NAME("city_name", "市名"),
        PROVINCE_NAME("province_name", "省名"),
        ADDRESS_NAME("address_name", "完整地址向量"),
        METADATA("metadata", "元数据");

        private String code;
        private String desc;
        AddressField(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public AddressField getByCode(String field) {
            for (AddressField value : values()) {
                if (value.name().equalsIgnoreCase(field)) {
                    return value;
                }
            }
            return null;
        }
    }

}
